import i18n from '@src/locales';
import FormAddressPreview from './FormAddressPreview.vue';
import FormAddressSetting from './FormAddressSetting.vue';
import FormAddressView from './FormAddressView.vue';

import CustomerAddressExtendSetting from './extend/CustomerAddressExtendSetting.vue'

import FormAuthorizAddressPreview from './extend/FormAuthorizAddressPreview.vue';
import ServiceManageExtendSetting from './extend/ServiceManageExtendSetting.vue';
import ServiceManageAddressSetting from "./extend/ServiceManageAddressSetting";

import FormAddressInternational from './FormAddressInternational.vue'

let FormAddressField = {
  formType: 'address', // 字段类型
  name: i18n.t('common.form.type.address'),
  isSystem: 0,
  component: {
    setting: FormAddressSetting,
    preview: FormAddressPreview,
    build: FormAddressInternational,
    view: FormAddressView,
    extend: {
      'customer_customerAddress_setting': CustomerAddressExtendSetting,
      'service_provider_providerAddress_setting': ServiceManageAddressSetting,
    }
  }
};
const ServiceManageAuthorizationAddressField = {
  formType: 'authorizeAddress',
  fieldName: 'authorizeAddress',
  name: i18n.t('common.form.type.authorizeAddress'),
  previewIcon: 'icon-fdn-customerAddress',
  forceDelete: true,
  isSystem: 1,
  component: {
    preview: FormAuthorizAddressPreview,
    build: FormAddressInternational,
    view: FormAddressView,
    extend: {
      'service_provider_authorizeAddress_setting': ServiceManageExtendSetting
    }
  }
}
export default [
  FormAddressField, 
  ServiceManageAuthorizationAddressField, // 服务商管理：授权地址
];